package com.xiaoshuidi.cloud.module.rooms.service;

import com.baomidou.mybatisplus.extension.service.IService;
import com.xiaoshuidi.cloud.framework.common.pojo.CommonResult;
import com.xiaoshuidi.cloud.framework.common.pojo.PageResult;
import com.xiaoshuidi.cloud.module.rooms.api.apartment.dto.ApartmentListDto;
import com.xiaoshuidi.cloud.module.rooms.api.apartment.vo.RecommendApartmentInfoRespVO;
import com.xiaoshuidi.cloud.module.rooms.controller.admin.apartment.vo.*;
import com.xiaoshuidi.cloud.module.rooms.controller.app.apartment.vo.ApartmentGuessListResp;
import com.xiaoshuidi.cloud.module.rooms.pojo.Apartment;

import java.util.List;

/**
 * 门店 Service 接口
 *
 * @author hans.zhang
 */
public interface ApartmentService extends IService<Apartment> {


    List<ApartmentMapVO> getMap();

    List<ApartmentRespVO> getApartments(List<Long> apartmentIds);

    /**
     * 批量更新经纬度
     */
    void updateLongitudeAndLatitude();

    public void updateLocation(Apartment apartment);

    /**
     * 删除门店
     *
     * @param apartmentId 门店id
     * @return
     */
    CommonResult<Boolean> delete(Long apartmentId);

    /**
     * 分散式房源获取门店详情
     *
     * @param roomHouseId 房间id
     * @param loginUserId
     * @return
     */
    CommonResult<DistributedDetailRespVO> distributedDetail(Long roomHouseId, Long loginUserId);

    /**
     * 编辑门店信息
     *
     * @param editVO
     * @return
     */
    CommonResult<Boolean> edit(ApartmentEditVO editVO);

    /**
     * 创建门店
     *
     * @param deptId
     * @param apartmentName
     * @return
     */
    CommonResult<Long> create(Long deptId, String apartmentName, Long tenantId);

    /**
     * 查看门店详情
     *
     * @param apartmentId 门店id
     * @return
     */
    CommonResult<ApartmentVO> detail(Long apartmentId);

    /**
     * 门店分页查询
     *
     * @param pageSize 每页大小
     * @param pageNum  第几页
     * @param name     门店名
     * @return
     */
    CommonResult<PageResult<ApartmentVO>> apartmentPageList(Integer pageSize, Integer pageNum, String name, Long apartmentId);

    /**
     * @param ids
     * @return
     */
    List<ApartmentListDto> listByIds(List<Long> ids);

    ApartmentListDto getById(Long id);

    /**
     * 查询所有门店
     *
     * @return
     */
    CommonResult<List<ApartmentVO>> myList(String apartmentName, Boolean isConcentrated);

    /**
     * 校验门店是否可以删除
     *
     * @param apartmentId 门店id
     * @return
     */
    CommonResult<Boolean> checkDelete(Long apartmentId);

    /**
     * 修改门店名称
     *
     * @param deptId
     * @param name
     * @return
     */
    CommonResult<Long> editApartmentName(Long deptId, String name);

    CommonResult<Boolean> deleteByDeptId(Long deptId);

    /**
     * 社区-获取推荐门店的信息
     *
     * @param apartmentIds
     * @param lat
     * @param lon
     * @return
     */
    CommonResult<List<RecommendApartmentInfoRespVO>> recommendApartmentInfo(List<Long> apartmentIds, String lat, String lon);

    Apartment queryApartmentByName(String apartmentName);

    CommonResult<List<RecommendApartmentInfoRespVO>> recommendApartmentInfoByName(String apartmentName);

    /**
     * 猜你喜欢 默认查询最新创建的10条数据
     *
     * @return
     */
    List<ApartmentGuessListResp> guessList();

}
